home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Gamer Resource Kit / Hardcore Gamer Resource Kit - Disc 2.iso / Utils / UNIX / UNZIP520 / WINGUI / WINIT.C < prev    next >
C/C++ Source or Header  |  1996-01-23  |  2KB  |  71 lines

  1. #include <stdio.h>
  2. #include "wingui\wizunzip.h"
  3.  
  4. long extern WINAPI WizUnzipWndProc(HWND, WORD, WPARAM, LPARAM);
  5.  
  6. /****************************************************************************
  7.  
  8.     FUNCTION: WizUnzipInit(HANDLE)
  9.  
  10.     PURPOSE: Initializes window data and registers window class
  11.  
  12.     COMMENTS:
  13.  
  14.         Sets up a structures to register the window class.  Structure includes
  15.         such information as what function will process messages, what cursor
  16.         and icon to use, etc.
  17.  
  18. ****************************************************************************/
  19. BOOL WizUnzipInit(HANDLE hInstance)
  20. {
  21.     WNDCLASS wndclass;
  22.  
  23.     wndclass.style = CS_HREDRAW | CS_VREDRAW;
  24.     wndclass.lpfnWndProc = (long (WINAPI*)(HWND,unsigned ,WPARAM,LPARAM)) WizUnzipWndProc;
  25.     wndclass.hInstance = hInstance;
  26.     wndclass.hIcon = LoadIcon(hInstance, "WizUnzip");
  27.     wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
  28.     wndclass.hbrBackground = (HBRUSH)(BG_SYS_COLOR+1); /* set background color */
  29.     wndclass.lpszMenuName = (LPSTR) "WizUnzip";
  30.     wndclass.lpszClassName = (LPSTR) szAppName;
  31.     wndclass.cbClsExtra     = 0;
  32.     wndclass.cbWndExtra     = 0;
  33.  
  34.     if ( !RegisterClass(&wndclass) )
  35.        {
  36.         return FALSE;
  37.        }
  38.  
  39.     /* define status class */
  40.     wndclass.lpszClassName = (LPSTR) szStatusClass;
  41.     wndclass.style = CS_HREDRAW | CS_VREDRAW;
  42.     wndclass.lpfnWndProc = (long (WINAPI*)(HWND,unsigned,unsigned,LONG))StatusProc;
  43.     wndclass.hInstance = hInstance;
  44.     wndclass.hIcon = LoadIcon(hInstance, "UNZIPPED");
  45.     wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
  46.     wndclass.hbrBackground = GetStockObject(WHITE_BRUSH);
  47.     wndclass.lpszMenuName = NULL;
  48.  
  49.     if ( !RegisterClass(&wndclass) )
  50.        {
  51.         return FALSE;
  52.        }
  53.    wndclass.style         = (UINT) NULL;
  54.    wndclass.lpfnWndProc   = (WNDPROC) ButtonBarWndProc;
  55.    wndclass.cbClsExtra    = 0;
  56.    wndclass.cbWndExtra    = 0;
  57.    wndclass.hInstance     = hInstance;
  58.    wndclass.hIcon         = NULL;
  59.    wndclass.hCursor       = NULL;
  60.    wndclass.hbrBackground = (HBRUSH) GetStockObject(LTGRAY_BRUSH);
  61.    wndclass.lpszMenuName  = NULL;
  62.    wndclass.lpszClassName = "ButtonBar";
  63.    if( !RegisterClass(&wndclass))
  64.       {
  65.         return( FALSE );
  66.       }
  67.  
  68.     return TRUE;
  69. }
  70.  
  71.